package com.kancy.demo.delay.queue.redis.message;

import com.kancy.delay.queue.redis.message.DelayMessage;

import java.time.Duration;

/**
 * <p>
 * PollingDelayMessage
 * <p>
 *
 * @author: kancy
 * @date: 2020/3/5 11:54
 **/

public class PollingDelayMessage extends DelayMessage {
    private String name;

    public PollingDelayMessage() {
    }

    public PollingDelayMessage(String topic, Object payload, Duration delay) {
        super(topic, payload, delay);
    }

    public PollingDelayMessage(String topic, Object payload, long delaySeconds) {
        super(topic, payload, delaySeconds);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("{")
                .append("name='").append(name).append("'").append(", ")
                .append("extents=").append(super.toString())
                .append("}");
        return builder.toString();
    }
}
